<?php
$this->breadcrumbs=array(
	'點數明細',
);
include_once('menu.php');
?>
<style>
td {
	border: solid #68BADA;
	border-width: 0px 1px 1px 0px;
	padding: 5px;
	text-align: center
}
table {
	border: solid #68BADA;
	border-width: 1px 0px 0px 1px;
}
.odd {
	background: none repeat scroll 0 0 #EEEEEE;
}
.even {
	background: none repeat scroll 0 0 #FFFFFF;
}
.three {
	background: none repeat scroll 0 0 #E5F1F4;
}
.jg {
	background: none repeat scroll 0 0 #ADD9ED;
}
.head {
	background: none repeat scroll 0 0 #90D8F0;
}
input, img {
	vertical-align: middle;
}
</style>
<div style="width:100%; float:left; margin-bottom:10px; text-align:right;">
	<form action="<?=Yii::app()->createUrl('user/index')?>" name="jobForm" id="jobForm" method="get">
		用戶	： <input type="text" name="username" value="<?php if(isset($search['username']))echo $search['username'];?>" id="username" size="10" />		
		<?php echo CHtml::dropDownList('cointype',$search['cointype'], Yii::app()->params['cointype']);?>
		<?php echo CHtml::dropDownList('coinsource',$search['coinsource'], Yii::app()->params['coinsource']);?>
		<?php echo CHtml::dropDownList('coinstatus',$search['coinstatus'], Yii::app()->params['coinstatus']);?>
		創建時間:	<input type="text" name="s" id="s" value="<?= $search['s'] ?>" readonly="readonly" style="width:80px;" />
		<img onclick="displayCalendar(document.jobForm.s,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" /> - 
		<input type="text" name="e" id="e" value="<?= $search['e'] ?>" readonly="readonly" style="width:80px;" />
		<img onclick="displayCalendar(document.jobForm.e,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" />
		<input type="image" src="images/go.png" id="jobSub" />	
		<input type="hidden" name="r" value="admin/credit" />
	</form>
</div>
<table cellspacing="0" cellpadding="0" width="100%" class="tbl">
	<tr class="head">
		<td width="15%">類別</td>
		<td width="20%">用戶</td>
		<td width="10%">來源</td>
		<td width="10%">數值</td>
		<td width="10%">狀態</td>
		<td width="20%">創建時間</td>
		<td>生效日期</td>
	</tr>
	<?php
    $i = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($rowTable as $row) {
        $trClass = $cssArr[$i % 3];
        $i++;
    ?>
	<tr class="<?= $trClass ?>">
		<td>
			<?=Yii::app()->params['cointype'][$row->type]?>
		</td>
		<td>
			<?=$row->user->username?>
		</td>
		<td>
			<?=Yii::app()->params['coinsource'][$row->source]?>
		</td>
		<td>
			<?=$row->amount?>
		</td>
		<td>
			<?=Yii::app()->params['coinstatus'][$row->status]?>
		</td>
		<td>
			<?=$row->dateline?>
		</td>
		<td>
			<?=$row->effectdate?>
		</td>	
	</tr>
	<?php
    }
    ?>
</table>
<div id="pager" align="center">
	<?php  
	$this->widget('CLinkPager',array(  
		'header'=>'',  
		'firstPageLabel' => '<<',
		'lastPageLabel' => '>>',
		'prevPageLabel' => '<',
		'nextPageLabel' => '>',
		'pages' => $pages,  
		'maxButtonCount'=>13  
		));  
?>
</div>
